package com.saihai.jiankang.Jkleave.service.impl;

import java.util.List;
import com.saihai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.saihai.jiankang.Jkleave.mapper.JkLeaveMapper;
import com.saihai.jiankang.Jkleave.domain.JkLeave;
import com.saihai.jiankang.Jkleave.service.IJkLeaveService;

/**
 * 请假Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-02
 */
@Service
public class JkLeaveServiceImpl implements IJkLeaveService 
{
    @Autowired
    private JkLeaveMapper jkLeaveMapper;

    /**
     * 查询请假
     * 
     * @param id 请假主键
     * @return 请假
     */
    @Override
    public JkLeave selectJkLeaveById(Long id)
    {
        return jkLeaveMapper.selectJkLeaveById(id);
    }

    /**
     * 查询请假列表
     * 
     * @param jkLeave 请假
     * @return 请假
     */
    @Override
    public List<JkLeave> selectJkLeaveList(JkLeave jkLeave)
    {
        return jkLeaveMapper.selectJkLeaveList(jkLeave);
    }

    /**
     * 新增请假
     * 
     * @param jkLeave 请假
     * @return 结果
     */
    @Override
    public int insertJkLeave(JkLeave jkLeave)
    {
        jkLeave.setCreateTime(DateUtils.getNowDate());
        return jkLeaveMapper.insertJkLeave(jkLeave);
    }

    /**
     * 修改请假
     * 
     * @param jkLeave 请假
     * @return 结果
     */
    @Override
    public int updateJkLeave(JkLeave jkLeave)
    {
        jkLeave.setUpdateTime(DateUtils.getNowDate());
        return jkLeaveMapper.updateJkLeave(jkLeave);
    }

    /**
     * 批量删除请假
     * 
     * @param ids 需要删除的请假主键
     * @return 结果
     */
    @Override
    public int deleteJkLeaveByIds(Long[] ids)
    {
        return jkLeaveMapper.deleteJkLeaveByIds(ids);
    }

    /**
     * 删除请假信息
     * 
     * @param id 请假主键
     * @return 结果
     */
    @Override
    public int deleteJkLeaveById(Long id)
    {
        return jkLeaveMapper.deleteJkLeaveById(id);
    }
}
